package com.itheima.d1_junit;

import org.junit.*;

import java.net.Socket;

public class StringUtilTest {

    @Before
    public void test1(){
        System.out.println("--->test1 before<------");

    }

    @BeforeClass
    public static void test11(){
        System.out.println("--->test1 beforeclass<------");
    }

    @After
    public void test2(){
        System.out.println("--->test2 after<-----");
    }

    @AfterClass
    public static void test22(){
        System.out.println("--->test2 afterclass<-----");
    }

    @Test
    public void testPrintNumber(){
        StringUtil.printNumber("admin");
        StringUtil.printNumber(null);
    }
    @Test
    public void testGetMaxIndex(){
        int index1 = StringUtil.getMaxIndex(null);
        System.out.println(index1);

        int index2 = StringUtil.getMaxIndex("admin");
        System.out.println(index2);

        Assert.assertEquals("方法内部有bug",4,index2);
    }
}
